<?php session_start();$_SESSION['page'] = 'admin';?>
<?php
    $adminID = $_GET['adminID'];

    require('db_connection.php');
    $query = "SELECT * FROM tbladmin WHERE adminID='$adminID'";
    $result = mysql_query($query);
    while ($row = mysql_fetch_array($result))
    {
        $userName = $row['userName'];
        $userType = $row['userType'];
        $libraryNo = $row['libraryNo'];
        $firstName = $row['firstName'];
        $middleName = $row['middleName'];
        $lastName = $row['lastName'];
        $password = $row['password'];
        $address = $row['address'];
        $contactNo = $row['contactNo'];
        $email = $row['email'];
        $userType = $row['userType'];
    }
    
    $qlib = "SELECT * FROM tbllibrary WHERE libraryNo='$libraryNo'";
    $rlib = mysql_query($qlib);
    while ($row = mysql_fetch_array($rlib))
    {
        $libraryName = $row['libraryName'];
    }
?>

<!doctype html public "-//W3C//DTD HTML 4.01//EN">
<html>

   <head>
      <title>Administrator Detail</title>
      <meta http-equiv="generator" content="PHP Designer 2005" />
      <style type="text/css">
        @import url(style.css);
      </style>
   </head>

   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000" class=''>

    <?php echo "<form method='post' action='update.php?page=admin&userName=$userName'>"; ?>
    <table width='80%' align='center' class='content'>
        <tr><td colspan='2'><img src='images/banner.jpg'></td></tr>
        <tr><td align='right' colspan='2' class='logout'><?php require ('loginout.php');?></td></tr>
        <tr class='menuborder'><td width='90%'><img src='images/admindetail.png'></td><td><?php  require('buttons2.php'); ?></td></tr>
        <tr><td colspan='2' class='bodyborder'>
            <table width='60%' align='center' cellpadding='3'>
                <tr><td height='30'></td></tr>
                <?php
                echo "<tr class='td1'><td>User Name</td>";
                echo "<td>$userName</td></tr>";
                echo "<tr class='td2'><td>Library Name</td>";
                echo "<td>$libraryName</td></tr>";
                echo "<tr class='td1'><td>First Name</td>";
                echo "<td>$firstName</td></tr>";
                echo "<tr class='td2'><td>Middle Name</td>";
                echo "<td>$middleName</td></tr>";
                echo "<tr class='td1'><td>Last Name</td>";
                echo "<td>$lastName</td></tr>";
                echo "<tr class='td2'><td>Password</td>";
                echo "<td>Not shown</td></tr>";
                echo "<tr class='td1'><td>Address</td>";
                echo "<td>$address</td></tr>";
                echo "<tr class='td2'><td>Contact No</td>";
                echo "<td>$contactNo</td></tr>";
                echo "<tr class='td1'><td>E-mail Address</td>";
                echo "<td>$email</td></tr>";
                echo "<tr class='td2'><td>User Type</td>";
                echo "<td>$userType</td></tr>";
                echo "<tr><td height='30' colspan='2'></td></tr>";
                ?>
            </table>
            </td>
        </tr>
        <tr><td align='center' colspan='2'><?php require ('copyright.php')?></td></tr>
    </table>
    </form>

   </body>
</html>

